package com.jsj.controller;

import com.jsj.domain.vo.ProblemSubmissionVo;
import com.jsj.service.ISubmissionService;
import com.ruoyi.common.core.controller.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/submission")
public class SubmissionController extends BaseController {
    @Autowired
    private ISubmissionService submissionService;

    /**
     * 查询题目提交
     */
    @PostMapping("/query")
    @ResponseBody
    @PreAuthorize("@ss.hasAnyRoles('teacher,admin')")
    public List<ProblemSubmissionVo> query(@RequestBody int[] id) {
        startPage();
        return submissionService.querySubmissionByProblemId(id[0], id[1]);
    }

}
